package a999.js;

import android.content.Context;
import android.util.Log;
import android.widget.Toast;

/**
 * Created by Administrator on 2017/7/13.
 */

public class LogPrint {
   public static String testLocal="android";


    public static void setTestLocal(String name){

        testLocal=name;

    }


    public static void  echo(String tag, String content){

        if(content.equals("") || content == null){

            content="is null or empty";
        }

        String TAG="log-----Tag:"+tag;
        if(testLocal.equals("android")) {
            Log.i(TAG, content);
        }else if(testLocal.equals("pc")){

            System.out.println("\n"+TAG+": "+content);
        }

    }
    public static void echo(String content){

        echo("log",content);
    }

    public static void toast(Context context, String content){

        if(testLocal.equals("android")){

            Toast.makeText(context,content, Toast.LENGTH_SHORT).show();
        }
    }






}
